package com.uinfor.service.impl;

import com.uinfor.dao.IStorageDao;
import com.uinfor.entity.Starage;
import com.uinfor.service.IStorageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @descripttion:
 * @Author: WZH
 * @Date :2021/2/5  16:34
 **/
@Service
public class StorageImpl implements IStorageService {
    @Resource
    private IStorageDao iStorageDao;

    @Override
    public void decrease(Long productId, Integer count) {
        int num = iStorageDao.findCountByProduceId(productId);
        iStorageDao.decrease(productId,num-count);
    }
}
